﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace CoderJoe.WoW.GearManager.Views
{
    public partial class ItemToolTip : UserControl
    {
        protected ItemToolTipController Controller { get; private set; }
        protected ItemToolTipModel Model { get; private set; }

        public ItemToolTip(ItemToolTipController controller, ItemToolTipModel model)
        {
            Controller = controller;
            Model = model;

            InitializeComponent();
        }

        public override Size GetPreferredSize(Size proposedSize)
        {
            return this.Size;
        }

        protected override void OnLoad(EventArgs e)
        {
            //this.DataBindings.Add("BackColor", Model, "BackgroundColor");

            this.itemNameLabel.DataBindings.Add("Text", Model, "Name");
            this.itemNameLabel.DataBindings.Add("ForeColor", Model, "NameColor");

            this.bondingLabel.DataBindings.Add("Text", Model, "PickupType");
            this.bondingLabel.DataBindings.Add("ForeColor", Model, "PickupTypeColor");

            this.inventoryTypeLabel.DataBindings.Add("Text", Model, "SlotType");
            this.inventoryTypeLabel.DataBindings.Add("ForeColor", Model, "SlotTypeColor");

            this.subclassNameLabel.DataBindings.Add("Text", Model, "ItemType");
            this.subclassNameLabel.DataBindings.Add("ForeColor", Model, "ItemTypeColor");

            base.OnLoad(e);
        }
    }
}
